home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 December / PCWDEC07.iso / Software / Shareware / HTMLPad Pro 2007 8.1 / htmlpad8.exe / {userappdata} / Blumentals / HTMLPad / settings / library.xml < prev    next >
Encoding:
Extensible Markup Language  |  2006-08-29  |  38.5 KB  |  381 lines

  1. <?xml version = "1.0"?><Folder-list><Folder><Expanded>False</Expanded>
  2. <Snippets></Snippets>
  3. <SubFolders><Folder><Expanded>False</Expanded>
  4. <Snippets><Snippet><Contents1><a href="</Contents1>
  5. <Contents2>"></a></Contents2>
  6. <ShCut>0</ShCut>
  7. <Title>Link</Title>
  8. </Snippet>
  9. <Snippet><Contents1><h1></Contents1>
  10. <Contents2></h1></Contents2>
  11. <ShCut>0</ShCut>
  12. <Title>Heading 1</Title>
  13. </Snippet>
  14. <Snippet><Contents1><h2></Contents1>
  15. <Contents2></h2></Contents2>
  16. <ShCut>0</ShCut>
  17. <Title>Heading 2</Title>
  18. </Snippet>
  19. <Snippet><Contents1><h3></Contents1>
  20. <Contents2></h3></Contents2>
  21. <ShCut>0</ShCut>
  22. <Title>Heading 3</Title>
  23. </Snippet>
  24. <Snippet><Contents1><p></Contents1>
  25. <Contents2></p></Contents2>
  26. <ShCut>0</ShCut>
  27. <Title>Paragraph</Title>
  28. </Snippet>
  29. <Snippet><Contents1><link rel="stylesheet" href="</Contents1>
  30. <Contents2>" type="text/css" /></Contents2>
  31. <ShCut>0</ShCut>
  32. <Title>CSS Link</Title>
  33. </Snippet>
  34. </Snippets>
  35. <SubFolders></SubFolders>
  36. <Title>Basic Tags</Title>
  37. </Folder>
  38. <Folder><Expanded>False</Expanded>
  39. <Snippets><Snippet><Contents1><div style="cursor: hand; width: 100px; padding: 5px; text-align: center; border: 1px solid Gray; background-color: #FFFFFF" onMouseOver="style.backgroundColor='#EEEEEE'" onMouseOut="style.backgroundColor='#FFFFFF'" onClick="self.location='http://www.blumentals.net'">   Click Me </div></Contents1>
  40. <Contents2></Contents2>
  41. <ShCut>0</ShCut>
  42. <Title>Hover Button</Title>
  43. </Snippet>
  44. <Snippet><Contents1><div style="border: 1px dashed Gray; padding: 5px"></Contents1>
  45. <Contents2></div></Contents2>
  46. <ShCut>0</ShCut>
  47. <Title>Dashed Box</Title>
  48. </Snippet>
  49. <Snippet><Contents1><hr style="height: 1px; color: Gray; border: dashed"></Contents1>
  50. <Contents2></Contents2>
  51. <ShCut>0</ShCut>
  52. <Title>Dashed Line</Title>
  53. </Snippet>
  54. <Snippet><Contents1><meta name="description" content=""> <meta name="keywords" content=""></Contents1>
  55. <Contents2></Contents2>
  56. <ShCut>0</ShCut>
  57. <Title>Search Engine Meta</Title>
  58. </Snippet>
  59. <Snippet><Contents1><!-- Replace #s with correct URLs --> <b><a href="#">Title of Section 1</a></b> <ul>   <li><a href="#">Title of Page 1.1</a></li>   <li><a href="#">Title of Page 1.2</a></li>   <li><a href="#">Title of Page 1.3</a></li> </ul> <b><a href="#">Title of Section 2</a></b> <ul>   <li><a href="#">Title of Page 2.1</a></li>   <li><a href="#">Title of Page 2.2</a></li>   <li><a href="#">Title of Page 2.3</a></li> </ul> <b><a href="#">Title of Section 3</a></b> <ul>   <li><a href="#">Title of Page 3.1</a></li>   <li><a href="#">Title of Page 3.2</a></li>   <li><a href="#">Title of Page 3.3</a></li> </ul></Contents1>
  60. <Contents2></Contents2>
  61. <ShCut>0</ShCut>
  62. <Title>Table of Contents</Title>
  63. </Snippet>
  64. <Snippet><Contents1><a href="home.htm">Home</a> | <a href="products.htm">Products</a> | <a href="services.htm">Services</a> | <a href="about.htm">About Us</a> | <a href="contact.htm">Contact</a></Contents1>
  65. <Contents2></Contents2>
  66. <ShCut>0</ShCut>
  67. <Title>Horizontal Menu</Title>
  68. </Snippet>
  69. <Snippet><Contents1><ul>   <li><a href="home.htm">Home</a>   <li><a href="products.htm">Products</a>   <li><a href="services.htm">Services</a>   <li><a href="about.htm">About Us</a>   <li><a href="contact.htm">Contact</a> </ul></Contents1>
  70. <Contents2></Contents2>
  71. <ShCut>0</ShCut>
  72. <Title>Vertical Menu</Title>
  73. </Snippet>
  74. <Snippet><Contents1><table width="400" border="1">   <tr>     <td><b>Title 1</b></td>     <td><b>Title 2</b></td>     <td><b>Title 3</b></td>   </tr>   <tr>     <td>Cell 1.1</td>     <td>Cell 1.2</td>     <td>Cell 1.3</td>   </tr>   <tr>     <td>Cell 2.1</td>     <td>Cell 2.2</td>     <td>Cell 2.3</td>   </tr> </table></Contents1>
  75. <Contents2></Contents2>
  76. <ShCut>0</ShCut>
  77. <Title>Table 3x3</Title>
  78. </Snippet>
  79. <Snippet><Contents1><script language="JavaScript" type="text/javascript"> <!-- function checkemail(emailstr){   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i   if (filter.test(emailstr)) {     return true;   } else {     return false;   } } function ValidateForm() {   if ((document.feedback_form.name.value!='')&&   (checkemail(document.feedback_form.email.value))&&   (document.feedback_form.comments.value!='')) {     return(true);   } else {     alert("Please enter all required data and use valid e-mail address.");     return(false);   } } --> </script> <!-- Form starts --> <form name="feedback_form" action="mailto:youremail@someserver.com" method="POST" onsubmit="return ValidateForm()"> <table width="100%" border="0"> <tr>   <td width="120">Name</td>   <td><input name="name" size="30" /></td> </tr> <tr>   <td width="120">E-mail</td>   <td><input name="email" size="30" /></td> </tr> <tr>   <td width="120" valign="top">Comments</td>   <td><textarea name="comments" rows="5" cols="40"></textarea></td> </tr> <tr>   <td>   </td>   <td>   <input type="submit" name="Submit" value="Submit" />&nbsp;<input type="reset" name="Reset" value="Reset" />   </td> </tr> </table> </form> <!-- Form ends --></Contents1>
  80. <Contents2></Contents2>
  81. <ShCut>0</ShCut>
  82. <Title>Feedback Form</Title>
  83. </Snippet>
  84. </Snippets>
  85. <SubFolders></SubFolders>
  86. <Title>Elements</Title>
  87. </Folder>
  88. </SubFolders>
  89. <Title>HTML</Title>
  90. </Folder>
  91. <Folder><Expanded>False</Expanded>
  92. <Snippets><Snippet><Contents1><script language="JavaScript"> <!-- </Contents1>
  93. <Contents2> --> </script></Contents2>
  94. <ShCut>0</ShCut>
  95. <Title>JavaScript Block HTML</Title>
  96. </Snippet>
  97. <Snippet><Contents1><script language="JavaScript"> /*<![CDATA[*/ </Contents1>
  98. <Contents2> /*]]>*/ </script></Contents2>
  99. <ShCut>0</ShCut>
  100. <Title>JavaScript Block XHTML</Title>
  101. </Snippet>
  102. <Snippet><Contents1><script language="JavaScript" src="</Contents1>
  103. <Contents2>"></script></Contents2>
  104. <ShCut>0</ShCut>
  105. <Title>JavaScript Link</Title>
  106. </Snippet>
  107. <Snippet><Contents1>if (</Contents1>
  108. <Contents2>) { }</Contents2>
  109. <ShCut>0</ShCut>
  110. <Title>IF Statement</Title>
  111. </Snippet>
  112. <Snippet><Contents1>function </Contents1>
  113. <Contents2>() { }</Contents2>
  114. <ShCut>0</ShCut>
  115. <Title>Function</Title>
  116. </Snippet>
  117. <Snippet><Contents1>alert("</Contents1>
  118. <Contents2>");</Contents2>
  119. <ShCut>0</ShCut>
  120. <Title>Alert</Title>
  121. </Snippet>
  122. <Snippet><Contents1>prompt("</Contents1>
  123. <Contents2>", "");</Contents2>
  124. <ShCut>0</ShCut>
  125. <Title>Prompt</Title>
  126. </Snippet>
  127. <Snippet><Contents1>confirm("</Contents1>
  128. <Contents2>")</Contents2>
  129. <ShCut>0</ShCut>
  130. <Title>Confirm</Title>
  131. </Snippet>
  132. <Snippet><Contents1>function checkemail(emailstr){   var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i   if (filter.test(emailstr)) {     return true;   } else {     return false;   } }</Contents1>
  133. <Contents2></Contents2>
  134. <ShCut>0</ShCut>
  135. <Title>E-mail Validator Function</Title>
  136. </Snippet>
  137. </Snippets>
  138. <SubFolders></SubFolders>
  139. <Title>JavaScript</Title>
  140. </Folder>
  141. <Folder><Expanded>False</Expanded>
  142. <Snippets><Snippet><Contents1><script language=JavaScript>   document.write("Browser Codename: ", navigator.appCodeName);   document.write("<br>Browser Name: ", navigator.appName);   document.write("<br>Browser Version: ", navigator.appVersion); </script></Contents1>
  143. <Contents2></Contents2>
  144. <ShCut>0</ShCut>
  145. <Title>Show Browser Info</Title>
  146. </Snippet>
  147. <Snippet><Contents1><script language="JavaScript"> var monthNames = new Array("January","February","March","April","May","June","July","August","September","October","November","December"); var monthNums = new Array("01","02","03","04","05","06","07","08","09","10","11","12"); var now = new Date(); // Display date in format Month DD, YYYY document.write(monthNames[now.getMonth()] + " " + now.getDate() + ", " + now.getYear()); document.write("<br>"); // Display date in format MM-DD-YYYY document.write(monthNums[now.getMonth()] + "-" + now.getDate() + "-" + now.getYear()); document.write("<br>"); // Display date in format DD.MM.YYYY document.write(now.getDate() + "." + monthNums[now.getMonth()] + "." + now.getYear()); </script></Contents1>
  148. <Contents2></Contents2>
  149. <ShCut>0</ShCut>
  150. <Title>Show Current Date</Title>
  151. </Snippet>
  152. <Snippet><Contents1><script language="JavaScript" type="text/javascript"> <!--   document.write("Last Modified " + document.lastModified) // --> </script></Contents1>
  153. <Contents2></Contents2>
  154. <ShCut>0</ShCut>
  155. <Title>Show Modified Date</Title>
  156. </Snippet>
  157. <Snippet><Contents1><script language="JavaScript" type="text/javascript"> <!--   document.write("This web page is located @ " + document.location); // --> </script></Contents1>
  158. <Contents2></Contents2>
  159. <ShCut>0</ShCut>
  160. <Title>Show Page Location</Title>
  161. </Snippet>
  162. <Snippet><Contents1><a href="javascript:self.close()">Close This Window</a></Contents1>
  163. <Contents2></Contents2>
  164. <ShCut>0</ShCut>
  165. <Title>Close Window Link</Title>
  166. </Snippet>
  167. <Snippet><Contents1><script language="JavaScript"> <!-- This Script And Over 400 Others Found At --!> <!--    Java City 2000 http://www.jc2k.com    --!> <!-- //The page they go to if they get it right. var goodURL = "correct.html"; alert("To access the following document, you must pass a "     + "members-only, authorization test.\n \n At the appropriate "     + "time, enter in your username and password."); var username = prompt("Enter in your username",""); var password = prompt("Enter in your password",""); if (username == null || password == null) {   alert("Authentication failed.")   history.back(); } else {   var combo = username + password   var total = combo.toLowerCase()   //This next line is where you can add usernames and passwords.   if (total == "mynamemypass" || total == "name2pass2" || total == "josh1help1")   {     alert("You passed authentication. Come right in!");     location = goodURL;   }   else   {     alert("Authentication failed.");     history.back();   } } //--> </script></Contents1>
  168. <Contents2></Contents2>
  169. <ShCut>0</ShCut>
  170. <Title>Password Protection</Title>
  171. </Snippet>
  172. <Snippet><Contents1><script language="JavaScript"> document.write("Hello, "); document.write(prompt("What is your Name?","Enter Name")); document.write(". Welcome to My Website!"); </script></Contents1>
  173. <Contents2></Contents2>
  174. <ShCut>0</ShCut>
  175. <Title>Prompt Sample</Title>
  176. </Snippet>
  177. <Snippet><Contents1><!-- Page body must have following OnLoad handler --> <body onload="if (self != top) top.location = self.location"></Contents1>
  178. <Contents2></Contents2>
  179. <ShCut>0</ShCut>
  180. <Title>Get Out Of Frames</Title>
  181. </Snippet>
  182. <Snippet><Contents1><script> // You can edit this list of colors and add new ones var bgcolors = new Array("#FFFFCC", "#CCFFCC", "#FFCCCC", "#DCDCDC", "#FFCC99") document.bgColor = bgcolors[Math.floor(Math.random()*bgcolors.length)] </script></Contents1>
  183. <Contents2></Contents2>
  184. <ShCut>0</ShCut>
  185. <Title>Random Background Color</Title>
  186. </Snippet>
  187. </Snippets>
  188. <SubFolders></SubFolders>
  189. <Title>JavaScript Instant Scripts</Title>
  190. </Folder>
  191. <Folder><Expanded>False</Expanded>
  192. <Snippets><Snippet><Contents1>a:link {   color: Blue } a:visited {   color: Purple } a:active {   color: Red } a:hover {   color: Red }</Contents1>
  193. <Contents2></Contents2>
  194. <ShCut>0</ShCut>
  195. <Title>Selector A (all)</Title>
  196. </Snippet>
  197. <Snippet><Contents1>body {   font-family: Verdana, Arial;   color: Black;   background-color: White; }</Contents1>
  198. <Contents2></Contents2>
  199. <ShCut>0</ShCut>
  200. <Title>Selector BODY</Title>
  201. </Snippet>
  202. <Snippet><Contents1>border: 1px dashed Gray;</Contents1>
  203. <Contents2></Contents2>
  204. <ShCut>0</ShCut>
  205. <Title>Border Dashed Grey</Title>
  206. </Snippet>
  207. <Snippet><Contents1>body {   /* Scrollbar styles are supported by Internet Explorer only  */   scrollbar-arrow-color: #333399;   scrollbar-face-color: #FFCC00;   scrollbar-highlight-color: #FFFF99;   scrollbar-3dlight-color: #333399;   scrollbar-shadow-color: #333399;   scrollbar-darkshadow-color: black;   scrollbar-track-color: #333399; }</Contents1>
  208. <Contents2></Contents2>
  209. <ShCut>0</ShCut>
  210. <Title>Scrollbar Style</Title>
  211. </Snippet>
  212. </Snippets>
  213. <SubFolders></SubFolders>
  214. <Title>CSS</Title>
  215. </Folder>
  216. <Folder><Expanded>False</Expanded>
  217. <Snippets><Snippet><Contents1>header("Location: http://www.blumentals.net"); exit;</Contents1>
  218. <Contents2></Contents2>
  219. <ShCut>0</ShCut>
  220. <Title>Redirect</Title>
  221. </Snippet>
  222. <Snippet><Contents1>// uncomment next line if running on PHP below 4.2.0 // srand((double)microtime()*1234567); $random = rand(0, 100); // between 0 and 100 inclusive</Contents1>
  223. <Contents2></Contents2>
  224. <ShCut>0</ShCut>
  225. <Title>Random Number</Title>
  226. </Snippet>
  227. </Snippets>
  228. <SubFolders><Folder><Expanded>False</Expanded>
  229. <Snippets><Snippet><Contents1>mail("nobody@example.com", "My Subject", "Line 1\nLine 2\nLine 3");</Contents1>
  230. <Contents2></Contents2>
  231. <ShCut>0</ShCut>
  232. <Title>Send Basic Message</Title>
  233. </Snippet>
  234. <Snippet><Contents1>// Some data for the message $mailTo = "nobody@example.com"; $mailFrom = "someone@example.com"; $mailFromName = "Some One"; $mailSubject = "Your Subject"; $mailMessage = "Your message."; // Send mail mail($mailTo, $mailSubject, $mailMessage, "From: $mailFromName <$mailFrom>\r\n");</Contents1>
  235. <Contents2></Contents2>
  236. <ShCut>0</ShCut>
  237. <Title>Send Simple Message</Title>
  238. </Snippet>
  239. <Snippet><Contents1>// Recipients $mailTo = "one@example.com, two@example.com"; // note the comma // Copies $mailCc = "three@example.com"; $mailBcc = "four@example.com"; // From $mailFrom = "someone@example.com"; $mailFromName = "Some One"; // Reply address $mailReplyTo = "noone@example.com"; // Message subject and contents $mailSubject = "Your Subject"; $mailMessage = "Your message.\n\nYour Signature"; // Text message charset $mailCharset = "windows-1252"; // must be accurate (e.g. "Windows - 1252" is invalid) // Create headres for mail() function $headers  = "Content-type: text/html; charset=$mailCharset\r\n"; $headers .= "From: $mailFromName <$mailFrom>\r\n"; $headers .= "Reply-To: $mailReplyTo\r\n"; $headers .= "Cc: $mailCc\r\n"; $headers .= "Bcc: $mailBcc\r\n"; // Send mail mail($mailTo, $mailSubject, $mailMessage, $headers); </Contents1>
  240. <Contents2></Contents2>
  241. <ShCut>0</ShCut>
  242. <Title>Send Complex Message</Title>
  243. </Snippet>
  244. </Snippets>
  245. <SubFolders></SubFolders>
  246. <Title>Mail</Title>
  247. </Folder>
  248. <Folder><Expanded>False</Expanded>
  249. <Snippets><Snippet><Contents1>// Select just one format from all the examples $today = date("F j, Y, g:i a");                 // e.g. March 10, 2001, 5:16 pm $today = date("m/d/y");                         // e.g. 03/10/04 $today = date("j, n, Y");                       // e.g. 10, 3, 2001 $today = date('\i\t \i\s \t\h\e jS \d\a\y.');   // e.g. it is the 10th day. $today = date("D M j G:i:s T Y");               // e.g. Sat Mar 10 15:16:08 MST 2001 $today = date("H:i:s");                         // e.g. 17:16:17 print $today; // See PHP manual for more</Contents1>
  250. <Contents2></Contents2>
  251. <ShCut>0</ShCut>
  252. <Title>Display Current Date</Title>
  253. </Snippet>
  254. <Snippet><Contents1>// Display past and future dates // Just add or substract days, months or years $tomorrow  = mktime (0,0,0,date("m"), date("d")+1, date("Y")); $lastmonth = mktime (0,0,0,date("m")-1, date("d"), date("Y")); $nextyear  = mktime (0,0,0,date("m"), date("d"), date("Y")+1); // Now you can use date values with date() function echo "Tomorrow is " . date("m/d/Y", $tomorrow) . "</br>"; echo "Before one month it was " . date("m/d/Y", $lastmonth) . "</br>"; echo "After a year it will be " . date("m/d/Y", $nextyear) . "</br>";</Contents1>
  255. <Contents2></Contents2>
  256. <ShCut>0</ShCut>
  257. <Title>Past and Future Date</Title>
  258. </Snippet>
  259. <Snippet><Contents1></Contents1>
  260. <Contents2>/*    Simple Calendar    by Karlis Blumentals (www.blumentals.net)    Displays a calendar, one month at a time.    Selected date is passed as parameter day=yyyy-mm-dd    e.g. myscript.php?day=2004-10-30 */ // date ok flag $dateok = false; // parse parameter if (isset($GLOBALS['day'])) {   list($yr, $mo, $da) = explode('-', $_GET['day']);   $yr = intval($yr);   $mo = intval($mo);   $da = intval($da);   if (checkdate($mo, $da, $yr)) $dateok = true; } // if invalid date selected then selected date = today if (!$dateok) {   $mo = date('m');   $da = date('d');   $yr = date('Y'); } $offset = date('w', mktime(0,0,0,$mo,1,$yr)); // we must have a value in range 1..7 if ($offset == 0) $offset = 7; // days in month $nd = date('d', mktime(0,0,0,$mo+1,0,$yr)); // days array $days = array(); // reset array for ($i=0;$i<=42;$i++) $days[$i]['out']= '&nbsp;'; // fill days array // valid days contain data, invalid days are left blank $j=1; for ($i=$offset;$i<=($offset+$nd-1);$i++) {   $day = $j++;   $date = $yr.'-'.$mo.'-'.$day;   $days[$i]['out']= '<a href="?day='.$date.'">'.$day.'</a>';   $days[$i]['dat']= $date; } // output table echo('<table border="1" cellpadding="3" cellspacing="0" width="200">'); echo('<tr>'); echo('<td colspan="1" align="center" class="linkbar"><a href="?day='.date('Y-m-d', mktime(0,0,0,$mo,$da,$yr-1)).'">&laquo;</a></td>'); echo('<td colspan="5" align="center" class="linkbar"><p class="calendar">'.$yr.'</p></td>'); echo('<td colspan="1" align="center" class="linkbar"><a href="?day='.date('Y-m-d', mktime(0,0,0,$mo,$da,$yr+1)).'">&raquo;</a></td>'); echo('</tr>'."\n"); echo('<tr>'); echo('<td colspan="1" align="center" class="linkbar2"><a href="?day='.date('Y-m-d', mktime(0,0,0,$mo,0,$yr)).'">&laquo;</a></td>'); echo('<td colspan="5" align="center" class="linkbar2"><p class="calendar">'.date('F', mktime(0,0,0,$mo,$da,$yr)).'</p></td>'); echo('<td colspan="1" align="center" class="linkbar2"><a href="?day='.date('Y-m-d', mktime(0,0,0,$mo+1,1,$yr)).'">&raquo;</a></td>'); echo('</tr>'."\n"); $cntr = 1; // day printing counter for ($i=1;$i<=6;$i++) {   echo('<tr>');   for ($j=1;$j<=7;$j++) {     $curr = $cntr++;     if ($days[$curr]['dat'] == $yr.'-'.$mo.'-'.$da) $style = 'bold'; else $style = 'normal';     echo('<td width="14%" style="font-weight: '.$style.'">'.$days[$curr]['out'].'</td>'."\n");   }   echo('</tr>'."\n"); } echo('</table>');</Contents2>
  261. <ShCut>0</ShCut>
  262. <Title>Calendar</Title>
  263. </Snippet>
  264. </Snippets>
  265. <SubFolders></SubFolders>
  266. <Title>Date and Time</Title>
  267. </Folder>
  268. <Folder><Expanded>False</Expanded>
  269. <Snippets><Snippet><Contents1>// Get image dimensions $myimg = "http://www.google.com/images/logo.gif"; // your image file list($width, $height, $type, $attr) = getimagesize($myimg); echo "Image size: $width x $height"; echo "<br /><img src=\"$myimg\" $attr />";</Contents1>
  270. <Contents2></Contents2>
  271. <ShCut>0</ShCut>
  272. <Title>Get Image Size</Title>
  273. </Snippet>
  274. </Snippets>
  275. <SubFolders></SubFolders>
  276. <Title>Images</Title>
  277. </Folder>
  278. <Folder><Expanded>True</Expanded>
  279. <Snippets><Snippet><Contents1></Contents1>
  280. <Contents2>    // List Directory Contents     $path = "test/"; // full path to the folder     $url = "http://www.example.com/test/"; // URL to files     // you must add slash (/) at the end     // Open the folder     $dir_handle = @opendir($path) or die("Unable to open $path");     // Loop through the files     while ($file = readdir($dir_handle)) {       if($file == "." || $file == "..")         continue;       if (is_file($path.$file)) {         echo "<a href=\"$url$file\">$file</a><br />";       } else {         echo "$file [DIR]<br />";       }     }     // Close     closedir($dir_handle);</Contents2>
  281. <ShCut>0</ShCut>
  282. <Title>List Directory Contents</Title>
  283. </Snippet>
  284. <Snippet><Contents1></Contents1>
  285. <Contents2>// enter valid full or relative file path or URL $myTextFile = 'data/yourfile.txt'; if (file_exists($myTextFile)) {   $text = implode('', file($myTextFile)); } else {   echo("File $mytextfile not found!");   $text = ''; } // $text now contains file contents, if any</Contents2>
  286. <ShCut>0</ShCut>
  287. <Title>Read Text from File</Title>
  288. </Snippet>
  289. <Snippet><Contents1></Contents1>
  290. <Contents2>// Save text to file $inputString = "This is the first line.\nThis is the seconds line."; // On Windows platformu, use \n\r instead of \n $fp = fopen( "data/yourfile.txt" , "w" ); fwrite($fp, $inputString); fclose($fp);</Contents2>
  291. <ShCut>0</ShCut>
  292. <Title>Save Text to File</Title>
  293. </Snippet>
  294. <Snippet><Contents1>unlink("data/yourfile.txt");</Contents1>
  295. <Contents2></Contents2>
  296. <ShCut>0</ShCut>
  297. <Title>Delete File</Title>
  298. </Snippet>
  299. </Snippets>
  300. <SubFolders></SubFolders>
  301. <Title>Files and Directories</Title>
  302. </Folder>
  303. </SubFolders>
  304. <Title>PHP</Title>
  305. </Folder>
  306. <Folder><Expanded>False</Expanded>
  307. <Snippets><Snippet><Contents1><% Response.Redirect "http://www.blumentals.net" %></Contents1>
  308. <Contents2></Contents2>
  309. <ShCut>0</ShCut>
  310. <Title>Redirect</Title>
  311. </Snippet>
  312. </Snippets>
  313. <SubFolders><Folder><Expanded>False</Expanded>
  314. <Snippets><Snippet><Contents1><%= FormatDateTime(Date, 0)%> <!-- e.g. 3/24/2005 --> <%= FormatDateTime(Date, 1)%> <!-- e.g. Friday, March 24, 2005 --></Contents1>
  315. <Contents2></Contents2>
  316. <ShCut>0</ShCut>
  317. <Title>Display Date</Title>
  318. </Snippet>
  319. <Snippet><Contents1><%= FormatDateTime(Now, 3)%> <!-- e.g. 11:24:13 PM --> <%= FormatDateTime(Now, 4)%> <!-- e.g. 23:24 --></Contents1>
  320. <Contents2></Contents2>
  321. <ShCut>0</ShCut>
  322. <Title>Display Time</Title>
  323. </Snippet>
  324. </Snippets>
  325. <SubFolders></SubFolders>
  326. <Title>Date and Time</Title>
  327. </Folder>
  328. <Folder><Expanded>False</Expanded>
  329. <Snippets><Snippet><Contents1><% ' replace /mydirectory with whatever you need ' you may use also the actual path ' e.g. C:\Inetpub\virtuals\mysite\mydirectory Set MyDirectory = Server.CreateObject("Scripting.FileSystemObject") Set MyFiles = MyDirectory.GetFolder(Server.MapPath("/mydirectory")) For each filefound in MyFiles.files %> <% =filefound.Name %> <br> <% Next %></Contents1>
  330. <Contents2></Contents2>
  331. <ShCut>0</ShCut>
  332. <Title>Show Directory Contents</Title>
  333. </Snippet>
  334. <Snippet><Contents1><% ' replace /mydirectory with whatever you need ' you may use also the actual path ' e.g. C:\Inetpub\virtuals\mysite\mydirectory Set MyFileSize = Server.CreateObject ("Scripting.FileSystemObject") MyPath = Server.MapPath("/mydirectory") Set MyFolder = MyFileSize.GetFolder(MyPath) %> <p><% =MyPath %> is <% =MyFolder.Size %> bytes</p></Contents1>
  335. <Contents2></Contents2>
  336. <ShCut>0</ShCut>
  337. <Title>Show Directory Size</Title>
  338. </Snippet>
  339. <Snippet><Contents1><% Dim oFilesys 'this line creates an instance of the File Scripting Object named filesys Set oFilesys = Server.CreateObject("Scripting.FileSystemObject") 'check if the file exists If NOT oFilesys.FileExists("C:\myfolder\myfile.txt") Then 'if does not exist, create the file oFilesys.CreateTextFile("C:\myfolder\myfile.txt") Else 'if the file exists, display message Response.Write "This file already exists." End If 'destroy file system object Set oFilesys = NOTHING %></Contents1>
  340. <Contents2></Contents2>
  341. <ShCut>0</ShCut>
  342. <Title>Create Text File</Title>
  343. </Snippet>
  344. <Snippet><Contents1><% ' use one of following constants to write/append Const ForWriting = 2, ForAppending = 8 Dim oFilesys, oFile Set oFilesys = CreateObject("Scripting.FileSystemObject") Set oFile = oFilesys.OpenTextFile("C:\myfolder\myfile.txt", ForWriting, True) oFile.Write "Hello World!" %></Contents1>
  345. <Contents2></Contents2>
  346. <ShCut>0</ShCut>
  347. <Title>Write to File</Title>
  348. </Snippet>
  349. <Snippet><Contents1><% Dim oFilesys, oFile, sFileContents Set oFilesys = CreateObject("Scripting.FileSystemObject") Set oFile = oFilesys.OpenTextFile("c:\myfolder\myfile.txt") sFileContents = oFile.ReadAll oFile.close Set oFile = nothing Set oFilesys = nothing Response.write(sFileContents) %></Contents1>
  350. <Contents2></Contents2>
  351. <ShCut>0</ShCut>
  352. <Title>Output File Contents</Title>
  353. </Snippet>
  354. </Snippets>
  355. <SubFolders></SubFolders>
  356. <Title>Files and Directories</Title>
  357. </Folder>
  358. </SubFolders>
  359. <Title>ASP</Title>
  360. </Folder>
  361. <Folder><Expanded>True</Expanded>
  362. <Snippets><Snippet><Contents1><a href="http://www.blumentals.net/webuilder/" target="_blank"> <img src="http://www.blumentals.net/img/webuilder_small.gif" width="88" height="31" border="0" alt="WeBuilder" /></a></Contents1>
  363. <Contents2></Contents2>
  364. <ShCut>0</ShCut>
  365. <Title>Small Banner (88x31)</Title>
  366. </Snippet>
  367. <Snippet><Contents1><a href="http://www.blumentals.net/webuilder/" target="_blank"> <img src="http://www.blumentals.net/img/webuilder_tiny.gif" width="80" height="15" border="0" alt="WeBuilder" /></a></Contents1>
  368. <Contents2></Contents2>
  369. <ShCut>0</ShCut>
  370. <Title>Tiny Banner (80x15)</Title>
  371. </Snippet>
  372. <Snippet><Contents1><a href="http://www.blumentals.net/webuilder/" target="_blank">Powered by WeBuilder</a></Contents1>
  373. <Contents2></Contents2>
  374. <ShCut>0</ShCut>
  375. <Title>Text Link</Title>
  376. </Snippet>
  377. </Snippets>
  378. <SubFolders></SubFolders>
  379. <Title>Powered by WeBuilder</Title>
  380. </Folder>
  381. </Folder-list>